package com.njit.farm.dataobject;

import com.njit.farm.model.Land;
import com.njit.farm.model.Seed;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

public class FLand {
    private String lId;

    private String lName;

    private String lStage;

    private Date lCreateTime;

    private Integer lTemperature;

    private Integer lHumidity;

    private Integer lLightpower;

    private Integer lCo2;

    private String lUrlAr;

    private String lSeeds;

    private String lTags;

    private String uId;

    public String getlId() {
        return lId;
    }

    public void setlId(String lId) {
        this.lId = lId;
    }

    public String getlName() {
        return lName;
    }

    public void setlName(String lName) {
        this.lName = lName;
    }

    public String getlStage() {
        return lStage;
    }

    public void setlStage(String lStage) {
        this.lStage = lStage;
    }

    public Date getlCreateTime() {
        return lCreateTime;
    }

    public void setlCreateTime(Date lCreateTime) {
        this.lCreateTime = lCreateTime;
    }

    public Integer getlTemperature() {
        return lTemperature;
    }

    public void setlTemperature(Integer lTemperature) {
        this.lTemperature = lTemperature;
    }

    public Integer getlHumidity() {
        return lHumidity;
    }

    public void setlHumidity(Integer lHumidity) {
        this.lHumidity = lHumidity;
    }

    public Integer getlLightpower() {
        return lLightpower;
    }

    public void setlLightpower(Integer lLightpower) {
        this.lLightpower = lLightpower;
    }

    public Integer getlCo2() {
        return lCo2;
    }

    public void setlCo2(Integer lCo2) {
        this.lCo2 = lCo2;
    }

    public String getlUrlAr() {
        return lUrlAr;
    }

    public void setlUrlAr(String lUrlAr) {
        this.lUrlAr = lUrlAr;
    }

    public String getlSeeds() {
        return lSeeds;
    }

    public void setlSeeds(String lSeeds) {
        this.lSeeds = lSeeds;
    }

    public String getlTags() {
        return lTags;
    }

    public void setlTags(String lTags) {
        this.lTags = lTags;
    }

    public String getuId() {
        return uId;
    }

    public void setuId(String uId) {
        this.uId = uId;
    }

    public Land toModel(){
        Land land = new Land();
        land.setId(this.lId);
        land.setName(this.lName);
        land.setLightPower(this.lLightpower);
        land.setHumidity(this.lHumidity);
        land.setCreateTime(this.lCreateTime);
        land.setCo2(this.lCo2);
        land.setStage(this.lStage);
        land.setTemperature(this.lTemperature);
        land.setuId(this.uId);
        land.setUrlAr(this.lUrlAr);
        land.setTags(Arrays.asList(lTags.split(",")));
        land.setSeeds(Arrays.asList(lSeeds.split(",")));
        return land;
    }
}